package com.gh.demo.mapper;

import com.gh.demo.entity.Goods;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface Receivemapper extends JpaRepository<Goods,Integer> {
    @Query(value = "select * from Goods order by id desc limit 1", nativeQuery = true)
      List<Goods> selectNew();

    @Query(value = "select name,type,sum(number) as number from goods group by name,type",nativeQuery = true)
    List<Object[]> selectCount();


}
